package day01;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/8
 */

/*
public class Test02 {
    public static void main(String[] args) {
        int x = 2;
        {
                int y = 6;
                System.out.println("x is " + x);
                System.out.println("y is " + y);
        }
        y = x; //y是在代码块内定义的，只能在代码块内使用
        System.out.println("x is " + x);
    }
}
 */
public class Test04 {
        public static void main(String[] args) {
            int x = 2;
            {
                int y = 6;
                System.out.println("x is " + x);
                System.out.println("y is " + y);
                y = x; //在代码块内使用
            }
            System.out.println("x is " + x);
        }
}
